<template>
  <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="num" :page-sizes="pagesize" :page-size="limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
  </el-pagination>
</template>

<script>
export default {
  name: 'MyPagination',
  props: {
    type: Array,
    num: Number,
    limit: Number,
    total: Number,
    pageSize: {
      default() {
        return []
      }
    }
  },
  methods: {
    handleSizeChange(page) {
      this.$emit('handleSizeChange', page)
    },
    handleCurrentChange(num) {
      this.$emit('handleCurrentChange', num)
    }
  },
  computed: {
    pagesize() {
      return this.pageSize.length === 0 ? [10, 15, 25, 100] : this.pageSize
    }
  }
}
</script>

<style lang="less" scoped>
.el-pagination {
  text-align: center;
}
</style>